{extend name="wap/b2c/base" /}
{block name="resources"}
<link rel="stylesheet" href="__TEMP__/{$style}/public/css/order.css">
<link rel="stylesheet" type="text/css" href="__TEMP__/{$style}/public/css/member_index.css">
<style>
.head-info {
	text-align: center;
	margin-top: 45px;
	border-bottom: 1px solid #F0F0F0;
	padding-top: 10px;
}
.popup{
	position:fixed;top: 36%;left: 0px;width: 100%;margin-left:0px;background: none;
}
.jiantou{
	top: 186px;
	    display: inline-block;
	    position: absolute;
	    right: 15px;
	    width: 8px;
	    height: 8px;
	    border-top: 1px solid #ccc;
	    border-right: 1px solid #ccc;
	    -webkit-transform: rotate(45deg);
}
.wchat-weixin{
	text-align: left;
}
.ali-pay{
	text-align: left;
}
</style>
{/block} 

	{block name="goodsHead"}
	<section class="head">
		<a class="head_back" onclick="window.history.go(-1)" href="javascript:void(0)"><i class="icon-back"></i></a>
		<div class="head-title">订单支付</div>
	</section>
	{/block}
{block name="main"}
<!-- <div class="head-info"> -->
<!-- 	<div style="float: left; width: 150px;"> -->
<!-- 		<img src="__TEMP__/{$style}/public/images/nk_shop.png" -->
<!-- 			style="width: 60px; height: 60px;" /> -->
<!-- 	</div> -->
<!-- 	<div style="float: left; line-height: 28px;"> -->
<!-- 		<p>￥{$pay_value.pay_money}</p> -->
<!-- 		<p>{$pay_value.pay_body}</p> -->
<!-- 	</div> -->
<!-- </div> -->
<div class="head-info" style="">
	<div class="head-pay">向{$platform_shopname}支付</div>
	<div class="head-pay-value">￥{$pay_value.pay_money}</div>
</div>
<div class="pay-type-item">
	<div class="pay-item-list" id="pay-type">支付方式<span id="pay-text" style="float: right;margin-right: 20px;">微信支付</span><span style="float:right" class="jiantou"></span></div>
	<div style="padding: 10px 0px;">支付人<span style="float:right;">{$member_info["user_info"]['nick_name']}</span></div>
</div>

<!-- 遮罩层 -->
	<div class="shade" style="display:none;"></div>
<!-- 弹出层 --> 
	<div class="popup" style="display:none;">
		
		<div class="codes">
		<div id="close"><p style="color:#999;">X</p></div>
		{if condition="$pay_config['wchat_pay_config']['is_use']==1"}
			<div class="wchat-weixin">
					<img src="__TEMP__/{$style}/public/images/weifu.png" class="wchat-photo">
					<span class="wchat-title">微信支付</span>
				<span id="wchatpay"></span> 
			</div>
		{/if}
		
		{if condition="$pay_config['ali_pay_config']['is_use']==1"} 
			<div class="ali-pay">
				<img src="__TEMP__/{$style}/public/images/zhifu.png" class="ali-photo">
				<span class="ali-item">支付宝支付</span>
				<span id="alipay"></span>
			</div>
		{/if}
		<input type="hidden" id="pay_type" value="0"> <input type="hidden" id="out_trade_no" value="{$pay_value.out_trade_no}">
		
		</div>
	</div>



<!-- <div style="padding: 8px 15px; margin-top: 10px; background: #FFF;"> -->
<!-- 	<div style="font-size: 16px;border-bottom:1px solid #ededed; padding: 5px 0px">支付方式</div> -->
<!-- 	{if condition="$pay_config['wchat_pay_config']['is_use']==1"} -->
<!-- 	<div style="padding: 5px 0px;"> -->
<!-- 		<img src="__TEMP__/{$style}/public/images/weifu.png" -->
<!-- 			style="margin-right: 10px"><span -->
<!-- 			style="font-size: 14px; line-height: 28px">微信支付</span><span -->
<!-- 			id="wchatpay" style="float: right"></span> -->
<!-- 	</div> -->
<!-- 	{/if} -->
<!-- 	{if condition="$pay_config['ali_pay_config']['is_use']==1"} -->
<!-- 	<div style="padding: 5px 0px"> -->
<!-- 		<img src="__TEMP__/{$style}/public/images/zhifu.png" -->
<!-- 			style="margin-right: 10px"><span -->
<!-- 			style="font-size: 14px; line-height: 31px">支付宝支付</span><span -->
<!-- 			id="alipay" style="float: right"></span> -->
<!-- 	</div> -->
<!-- 	{/if} -->
<!-- 	<input type="hidden" id="pay_type" value="0"> <input -->
<!-- 		type="hidden" id="out_trade_no" value="{$pay_value.out_trade_no}"> -->
<!-- </div> -->
<!-- <div style="height:45px"></div> -->
<!--   需要微信支付，此处移至待付款订单，显示下面按钮 begin -->

	
	{include file="wap/b2c/controlCopyRight"}
<section class="s-btn"
	style="position: fixed; left: 0; right: 0; bottom: 0; height: 50px; padding: 0; z-index: 5;">
	<button class="alipay" type="button" onclick="calculate()">确认支付￥{$pay_value.pay_money}</button>
</section>
<script>
	var __IMG__ = '__TEMP__/{$style}/public/images';
	function calculate() {
		var pay_type = $("#pay_type").val();
		var out_trade_no = $("#out_trade_no").val();
		if (pay_type == 0) {
			//微信支付
			window.location.href = "APP_MAIN/pay/wchatpay?no=" + out_trade_no;
		} else if (pay_type == 1) {
			//支付宝支付
			window.location.href = "APP_MAIN/pay/alipay?no=" + out_trade_no;
		}
	}
	
	$("#pay-type").click(function(){
		$(".shade").show();
		$(".popup").show();
	})
	

	$("#wchatpay").html("<img src='" + __IMG__ + "/segou.png'>");
	$("#alipay").html("<img src='" + __IMG__ + "/hgou.png'>");

	$(".ali-pay").click(function() {
		$(".shade").hide();
		$(".popup").hide();
		$("#pay_type").val(1);
		var pay_type = $("#pay_type").val();
		if (pay_type == 1) {
			$("#alipay").html("<img src='" + __IMG__ + "/segou.png'>");
			$("#wchatpay").html("<img src='" + __IMG__ + "/hgou.png'>");
			$("#pay-text").html("支付宝支付");
		} else {
			$("#wchatpay").html("<img src='" + __IMG__ + "/segou.png'>");
			$("#alipay").html("<img src='" + __IMG__ + "/hgou.png'>");
			$("#pay-text").html("微信支付");
		}
	})
	$(".wchat-weixin").click(function() {
		$(".shade").hide();
		$(".popup").hide();
		$("#pay_type").val(0);
		var pay_type = $("#pay_type").val();
		if (pay_type == 0) {
			$("#alipay").html("<img src='" + __IMG__ + "/hgou.png'>");
			$("#wchatpay").html("<img src='" + __IMG__ + "/segou.png'>");
			$("#pay-text").html("微信支付");
		} else {
			$("#wchatpay").html("<img src='" + __IMG__ + "/hgou.png'>");
			$("#alipay").html("<img src='" + __IMG__ + "/segou.png'>");
			$("#pay-text").html("支付宝支付");
		}
	})
	$("#close").click(function(){
		$(".shade").hide();
		$(".popup").hide();
	})
</script>
{/block} {block name="bottom"} {/block}